package com.ringtheweb.serviceprovider.weather.core;

import java.net.URL;
import java.util.List;

import com.ringtheweb.serviceprovider.weather.model.Location;
import com.ringtheweb.serviceprovider.weather.model.LocationType;
import com.ringtheweb.serviceprovider.weather.model.Transition;


public class WorldToWorldRegionRetriever extends AbstractHttpLocationRetriever {
	
	public WorldToWorldRegionRetriever() {
		super("//div[@class='yw-categories']/ul[@class='columns']/li/a");
	}

	public Transition<LocationType> getTransition() {
		return new Transition<LocationType>(LocationType.WORLD,LocationType.WORLD_REGION);
	}
	
	public static void main(String[] args) throws Throwable {
		WorldToWorldRegionRetriever w = new WorldToWorldRegionRetriever();
		List<Location> locations = w.retrieveChildren(new Location("world",LocationType.WORLD,new URL("http://weather.yahoo.com")));
		
		for (Location location: locations) {
			System.out.println(location);
		}
	}

}
